package testJdk.base.config;

import java.io.InputStream;
import java.util.Properties;

public class GlobalConfig {

    private static final GlobalConfig INSTANCE = new GlobalConfig();

    private Properties properties = new Properties();

    private GlobalConfig() {

        try {
            InputStream in = getClass().getResourceAsStream("myapp.properties");
            properties.load(in);
            in.close();
        } catch (Exception e) {
           // e.printStackTrace();
            throw new RuntimeException("加载配置信息失败");
        }
    }

    public static GlobalConfig getInstance() {
        return INSTANCE;
    }

    public Properties getProperties() {
        return properties;
    }
}
